#include "FAN.h"
#include "LiquidLevel.h"
#include "Relay.h"
#include<Arduino.h>
#include <WiFi.h>
#include <Preferences.h>

#include "TdrLiquidSensorGlobal.hpp"
#include "parseCMD.hpp"
#include "FanData.hpp"

// shared projects
#include "Identify/Identity.hpp"
#include "wire/Wire.h"
#include "capSensor/capSensor.h"
#include "onlineLoop.hpp"
#include "Core0Task.hpp"
#include "Core1Task.hpp"
//#include <Core1Task.cpp>
//#include <FanData.cpp>
#define ANSWER_WHO "TdrLiquidsor"
#define VERSION "2025.02.25.a"


/*


*/
TaskHandle_t NULLHandle = NULL;
QueueHandle_t ParaRelease;
QueueHandle_t ParaReturn;


//#include <FreeRTOSConfig.h>
//TimerHandle_t dbgtim;
//char dbginf[255];
//static void DEBUGCB(TimerHandle_t xTimer)
//{
//	vTaskList(dbginf);
//	Serial.println(dbginf);
//}

void setup()
{

	Serial.begin(115200);

	ParaRelease = xQueueCreate(5, sizeof(ParaConfig_t));
	ParaReturn = xQueueCreate(5, sizeof(ParaConfig_t));
	xTaskCreate(TaskRelay, "Relay", 2048, NULL, 3, &NULLHandle);
	xTaskCreate(TaskLiquid, "Liquid", 2048, NULL, 2, &NULLHandle);
	xTaskCreate(TaskFan, "Fan", 2048, NULL, 4, &NULLHandle);
	xTaskCreate(TaskCMD, "CMD", 4096, NULL, 5, &NULLHandle);

	//dbgtim = xTimerCreate("DEBUG",
	//						pdMS_TO_TICKS(1000),
	//						pdTRUE,
	//						NULL,
	//						DEBUGCB);

	Identity::init(ANSWER_WHO, VERSION);
	CapSensor::init();

}

void loop()
{

}

// change log
// 2025.02.25 Creat a new project